import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-04-16
 * Time: 16:08
 */
public class Demo6 {
    public static void main(String[] args) throws IOException {
        File f1 = new File("./test0.txt");
        f1.createNewFile();
        System.out.println(f1.getAbsolutePath());
        File f2 = new File("test1.txt");//
       f1.renameTo(f2);//进行文件改名:./test0.txt  改成 test1.txt
    System.out.println(f1.getAbsolutePath());
    }
}
